from django.db import models


# Create your models here.
class Book(models.Model):
    '''
    生成迁移脚本文件: python manage.py makemigrations
    迁移脚本文件映射到数据库：python manage.py migrate
    '''
    # TODO: id 整形 自增长 主键
    id = models.AutoField(primary_key=True)
    # TODO: name varchar 100 不能为空
    name = models.CharField(max_length=100, null=False)
    # TODO: author varchar 100 不能为空
    author = models.CharField(max_length=100, null=False)
    # TODO: price double 浮点数 不能为空
    price = models.FloatField(default=0, null=False)


class Publishing(models.Model):
    id = models.AutoField(primary_key=True)
    publishinghouse = models.CharField(max_length=100, null=False)
